1828c48ff0edd514f3fb3bee8eb5a8a36f5cfa12,src/org/graphstream/util/Environment.java,Environment,invokeSetMethod,#Object#Method#Class#String#String#,466

Before Change


					Logger
							.getGlobalLogger()
							.log(
									Logger.LogLevel.WARN,
									this.getClass().getName(),
									"cannot set '%s' to the value '%s', values is not a long%n",
									method.toString(), value );
				}
			}
			else if( types[0] == Integer.TYPE )
			{
				try
				{
					int val = (int) Double.parseDouble( value );
					method.invoke( object, new Integer( val ) );
				}
				catch( NumberFormatException e )
				{
					Logger
							.getGlobalLogger()
							.log(
									Logger.LogLevel.WARN,
									this.getClass().getName(),
									"cannot set '%s' to the value '%s', values is not a int%n",
									method.toString(), value );
				}
			}
			else if( types[0] == Double.TYPE )
			{
				try
				{
					double val = Double.parseDouble( value );
					method.invoke( object, new Double( val ) );
				}
				catch( NumberFormatException e )
				{
					Logger
							.getGlobalLogger()
							.log(
									Logger.LogLevel.WARN,
									this.getClass().getName(),
									"cannot set '%s' to the value '%s', values is not a double%n",
									method.toString(), value );
				}
			}
			else if( types[0] == Float.TYPE )
			{
				try
				{
					float val = Float.parseFloat( value );
					method.invoke( object, new Float( val ) );
				}
				catch( NumberFormatException e )
				{
					Logger
							.getGlobalLogger()
							.log(
									Logger.LogLevel.WARN,
									this.getClass().getName(),
									"cannot set '%s' to the value '%s', values is not a float%n",
									method.toString(), value );
				}
			}
			else if( types[0] == Boolean.TYPE )
			{
				try
				{
					boolean val = false;
					value = value.toLowerCase();

					if( value.equals( "1" ) || value.equals( "true" )
							|| value.equals( "yes" ) || value.equals( "on" ) )
						val = true;

					method.invoke( object, new Boolean( val ) );
				}
				catch( NumberFormatException e )
				{
					Logger
							.getGlobalLogger()
							.log(
									Logger.LogLevel.WARN,
									this.getClass().getName(),
									"cannot set '%s' to the value '%s', values is not a boolean%n",
									method.toString(), value );
				}
			}
			else if( types[0] == String.class )
			{
				method.invoke( object, value );
			}
			else
			{
				Logger.getGlobalLogger().log( Logger.LogLevel.WARN,
						this.getClass().getName(),
						"cannot match parameter '%s' and the method '%s'%n",
						value, method.toString() );
			}
		}
		catch( InvocationTargetException ite )
		{
			Logger
					.getGlobalLogger()
					.log(
							Logger.LogLevel.WARN,
							this.getClass().getName(),
							"cannot invoke method '%s' : invocation targer error : %s%n",
							method.toString(), ite.getMessage() );
		}
		catch( IllegalAccessException iae )
		{
			Logger.getGlobalLogger().log( Logger.LogLevel.WARN,
					this.getClass().getName(),
					"cannot invoke method '%s' : illegal access error : %s%n",
					method.toString(), iae.getMessage() );

After Change


				}
				catch( NumberFormatException e )
				{
					logger.warning(String.format("cannot set '%s' to the value '%s', values is not a int%n", method.toString(), value));
				}
			}
			else if( types[0] == Double.TYPE )
			{
				try
				{
					double val = Double.parseDouble( value );
					method.invoke( object, new Double( val ) );
				}
				catch( NumberFormatException e )
				{
					logger.warning(String.format("cannot set '%s' to the value '%s', values is not a double%n", method.toString(), value));
				}
			}
			else if( types[0] == Float.TYPE )